/*
 * @Author: _LJP 2634716776@qq.com
 * @Date: 2023-12-24 10:51:32
 * @LastEditors: _LJP 2634716776@qq.com
 * @LastEditTime: 2023-12-24 10:52:41
 * @FilePath: /my_-linux/Pro23/WorkTestAll/Test1224/test.cpp
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include<iostream>

using namespace std;

// int main()
// {
//     // cout<<"hello world"<<endl;

    

//     return 0;
// }

class A{

public:
    A() : m_iVal(0) { test(); }

    virtual void func() { std::cout << m_iVal << " "; }

    void test() { func(); }

public:
    int m_iVal;
};

class B : public A

{

public:
    B() { test(); }

    virtual void func()

    {

        ++m_iVal;

        std::cout << m_iVal << " ";
    }
};

int main(int argc, char *argv[])

{
    A *p = new B;

    p->test();

    return 0;
}